<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

<h:head>
	<title>Riepilogo acquisto giftlist</title>
	<h:outputStylesheet library="TdTheme" name="css/style.css"/> 	
</h:head>
<h:form>      
	    <p:menubar>
	    	<p:menuitem value="Homepage" icon="ui-icon-contact" url="home.xhtml?faces-redirect=true"/> 
	         
	        <f:facet name="options">
	        	<p:outputLabel value="Benvenuto, #{utenteManagedBean.nome}" style="margin-right:10px"/>  
	            <p:commandButton value="Modifica Profilo" icon="ui-icon-contact" action="modifica_utente.xhtml?faces-redirect=true"/>
	            <p:commandButton value="Logout" icon="ui-icon-extlink" action="#{loginManagedBean.logout()}"/>  
	        </f:facet>  
	    </p:menubar>  
  	</h:form>
	<h:form id ="riepilogo">  
	    <p:growl id="growl" showDetail="true" sticky="true" />  
	    <p:dataTable var="att" value="#{amicoManagedBean.listaAttivitaSelezionate}">  
	        <p:column headerText="ID">  
	            <h:outputText value="#{att.id}" />  
	        </p:column>  
	  
	        <p:column headerText="Descrizione">  
	            <h:outputText value="#{att.descrizione}" />  
	        </p:column>  
	  
	        <p:column headerText="Prezzo">  
	            <h:outputText value="#{att.prezzo}" />  
	        </p:column>  
	    </p:dataTable>  
	    
	    <p:commandButton id="acquistaBtn" value="Acquista" action="#{amicoManagedBean.ultimaAcquistoDaGL()}" disabled="#{amicoManagedBean.acquistoGiftListDisabilitato}">
	     	<f:ajax execute="riepilogo" render="acquistaBtn" onevent="ultimaAcquistoDaGL" />
	     </p:commandButton>
	    <p:commandButton value="Vai al tuo profilo" action="#{amicoManagedBean.vaiAdHome()}"/>
	    <!-- <p:messages autoUpdate="true" closable="true" id="error" /> -->
 	</h:form>  
 	
         
<h:body>
</h:body>
</html>